/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.company.management.entity;

import java.io.Serializable;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Paner
 */
@Entity
@Table(name = "employeeinfo", catalog = "cafedb", schema = "", uniqueConstraints = {
    @UniqueConstraint(columnNames = {"EMPLOYEEID"})})
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "EmployeeInfo.findAll", query = "SELECT e FROM EmployeeInfo e"),
    @NamedQuery(name = "EmployeeInfo.findById", query = "SELECT e FROM EmployeeInfo e WHERE e.id = :id"),
    @NamedQuery(name = "EmployeeInfo.findByBehavior", query = "SELECT e FROM EmployeeInfo e WHERE e.behavior = :behavior"),
    @NamedQuery(name = "EmployeeInfo.findByPenalty", query = "SELECT e FROM EmployeeInfo e WHERE e.penalty = :penalty"),
    @NamedQuery(name = "EmployeeInfo.findByComments", query = "SELECT e FROM EmployeeInfo e WHERE e.comments = :comments")})
public class EmployeeInfo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID", nullable = false)
    private Integer id;
    @Column(name = "BEHAVIOR", length = 255)
    private String behavior;
    @Column(name = "PENALTY")
    private Integer penalty;
    @Column(name = "COMMENTS", length = 4096)
    private String comments;
    @JoinColumn(name = "EMPLOYEEID", referencedColumnName = "ID", nullable = false)
    @OneToOne(optional = false, fetch = FetchType.LAZY)
    private Employee employeeid;

    public EmployeeInfo() {
    }

    public EmployeeInfo(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getBehavior() {
        return behavior;
    }

    public void setBehavior(String behavior) {
        this.behavior = behavior;
    }

    public Integer getPenalty() {
        return penalty;
    }

    public void setPenalty(Integer penalty) {
        this.penalty = penalty;
    }

    public String getComments() {
        return comments;
    }

    public void setComments(String comments) {
        this.comments = comments;
    }

    public Employee getEmployeeid() {
        return employeeid;
    }

    public void setEmployeeid(Employee employeeid) {
        this.employeeid = employeeid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EmployeeInfo)) {
            return false;
        }
        EmployeeInfo other = (EmployeeInfo) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.company.management.entity.EmployeeInfo[ id=" + id + " ]";
    }
    
}
